﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.MODEL.FoundationModel;

namespace MINERP.ComplexOrder.Frms
{
    public partial class FrmNumSure : Form
    {
        public delegate void PassSelectNum(int SelectNum);
        public event PassSelectNum PassNum;
        public FrmNumSure()
        {
            InitializeComponent();
        }
        public ComplexOrderInfo CurrProduct {get;set;}

        private void FrmNumSure_Load(object sender, EventArgs e)
        {
            //richTextBox1.Text = "确定给商户 " + CurrProduct.ShopName + " 的客人 " + CurrProduct.CtmName + " 的产品 " + CurrProduct.OrderProductName + " 排单生产吗？";
            labelShopNme.Text = CurrProduct.ShopName;
            labelCtmName.Text = CurrProduct.CtmName;
            labelProductName.Text = CurrProduct.OrderProductName;
            textEdit1.Text = CurrProduct.ProductNum.ToString();
            
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            int  selectNum=Convert.ToInt32(textEdit1.Text);
            if (selectNum <= 0 || selectNum > CurrProduct.ProductNum)
            {
                MessageBox.Show("请输入正确数量");
                return ;

            }
            PassNum(selectNum);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
